package com.jerry.hm.algorithm.recursion;

/**
 * 反向打印字符串
 *
 * @author Jerry
 * @since 2024/9/30 19:00
 */
public class ReversePrintString {

    public static void fun(int index, String s) {
        if (index == s.length()) {
            return;
        }
        fun(index + 1, s);
        System.out.print(s.charAt(index));
    }

    public static void main(String[] args) {
        fun(0, "0123456789");
    }
}
